// 引入request
import request from '../util/request.js';
import config from '../util/config.js';
const TechniqueRequest = {
    BASE_URL : config.proUrl + "/pro",
    // 请求过程在这里开发，不在.vue文件中开发
    /**
     * 多条件分页查询technique列表
     * @param technique
     * @param callBack
     */
    loadTechnique(technique, callBack){
        // 拼接url  /sys/queryByPage?xxx
        let url = this.BASE_URL + "/technique/queryByPage";
        // 调用request进行请求  http://lcation
        request.get(url,technique,callBack);
    },
    /**
     * 新增工序的API
     * @param technique
     * @param callBack
     */
    addTechnique(technique,callBack){
        let url = this.BASE_URL + "/technique/saveTechnique"
        request.post(url,technique,callBack);
    },
    /**
     * 通过id加载工序信息的API
     * @param techniqueId
     * @param callBack
     */
    getById(techniqueId,callBack){
        let url = this.BASE_URL + "/technique/queryById?techniqueId=" + techniqueId;
        // let url = this.BASE_URL + "/technique/queryById?techniqueId=1";
        request.get(url,null,callBack);
    }
    ,
    /**
     * 修改工序信息的API
     * @param technique
     * @param callBack
     */
    updateTechnique(technique,callBack){
        let url = this.BASE_URL + "/technique/update";
        request.post(url,technique,callBack);
    },
    /**
     *  删除工序的API
     * @param techniqueId
     * @param callBack
     */
    deleteTechnique(techniqueId,callBack){
        request.get(this.BASE_URL + "/technique/delete?techniqueId=" + techniqueId,null,callBack);
    },
    /**
     * 批量删除工序的API
     * @param techniqueIds
     * @param callBack
     */
    deleteTechniques(techniqueIds,callBack){
        console.log(techniqueIds)
        let url = this.BASE_URL + "/technique/deletes?techniqueIds="+techniqueIds;
        request.get(url,null,callBack);
    }
}
// 导出我们申明的techniqueRequest对象
export default TechniqueRequest;